/**
 *
 */
package com.hcr.kingdeeutil.util;

import java.io.*;
import java.util.Properties;

/**
 * @ClassName: PropertiesRead
 * @date Jan 15, 2012 11:05:54 AM
 */
public class PropertiesRead {

	public static Properties props = new Properties();
	private static final String CONFIG_FILE_URL = "config.properties";

	static {
		try {
			props.load(new InputStreamReader(PropertiesRead.class.getClassLoader().getResourceAsStream(CONFIG_FILE_URL), "UTF-8"));
		} catch (Exception e) {
			// System.out.println("加载失败");
			e.printStackTrace();
		}
	}

	private PropertiesRead() {

	}

	/**
	 * 获取资源文件中相应配置项的值
	 *
	 * @param key
	 * @return value
	 */
	public static String getValue(String key) {
		return props.getProperty(key);
	}

	public static void main(String[] args) {
		System.out.println(PropertiesRead.getValue("email.info"));
	}

}
